/**
 * 2315. 统计星号
 * @param {string} s
 * @return {number}
 */
var countAsterisks = function (s) {
	let res = 0,
		valid = false
	for (let i = 0; i < s.length; i++) {
		if (s[i] === '|') {
			valid = !valid
		} else if (s[i] === '*' && !valid) {
			res++
		}
	}
	return res
}
